/*
 * @Descripttion: 文件说明
 * @version: V1.0
 * @Author: GW
 * @Date: 2021-07-29 10:40:41
 * @LastEditors: GW
 * @LastEditTime: 2021-10-12 09:59:56
 */
import { axios } from '../../utils/request'

/**
 * MRP运算
 */
const api = {
    save: '/mrp/save',
    list: '/mrp/getProgrammeList',
    delete: '/mrp/delete',
    saleOrderList: '/mrp/getSaleOrderList',
    planList: '/mrp/getProductionPlanList',
    start: '/mrp/operation',
    code:'/mrp/getCode',
    MRPcode:'mrp/operation/getCode',
    mrpSave: '/mrp/operation/save',
    mrpDelete: '/mrp/operation/delete',
    mrpSubmit: '/mrp/operation/submit',
    mrpExamine: '/mrp/operation/examine',
}
/**
 * 保存方案
 */
export function save(data) {
    return axios({
        url: api.save,
        method: "post",
        data: data
    })
}
/**
 * 获取方案列表
 */
export function list(data) {
    return axios({
        url: api.list,
        method: "get",
        params: data
    })
}
/**
 * 获取mrp运算编码
 */
 export function code(data) {
    return axios({
        url: api.code,
        method: "get",
        params: data,
    })
}

export function MRPcode(data) {
    return axios({
        url: api.MRPcode,
        method: "get",
        params: data,
    })
}


/**
 * 删除
 */
export function remove(data) {
    return axios({
        url: api.delete,
        method: "DELETE",
        params: data
    })
}

/**
 * 选择销售订单 
 */
export function saleOrderList(data) {
    return axios({
        url: api.saleOrderList,
        method: "get",
        params: data
    })
}
/**
 * 选择生产计划
 */
export function planList(data) {
    return axios({
        url: api.planList,
        method: "get",
        params: data
    })
}
/**
 * 开始计算
 */
export function startOper(data) {
    return axios({
        url: api.start,
        method: "post",
        data: data,
        timeout:300000
    })
}
/**
 * MRP运算向导保存
 */
 export function mrpSave(data) {
    return axios({
        url: api.mrpSave,
        method: "post",
        data: data,
        timeout:300000
    })
}
/**
 * MRP运算向导删除单据
 */
 export function mrpDelete(data) {
    return axios({
        url: api.mrpDelete,
        method: "delete",
        params: data
    })
}
/**
 * MRP运算向导提交单据
 */
 export function mrpSubmit(data) {
    return axios({
        url: api.mrpSubmit,
        method: "get",
        params: data
    })
}

/**
 * MRP运算向导审核单据
 */
 export function mrpExamine(data) {
    return axios({
        url: api.mrpExamine,
        method: "get",
        params: data
    })
}